/**
 * Created by lwy on 2017/7/12.
 */

function getItem(name){
    var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
    if (arr != null) return unescape(arr[2]); return null;
}
function setItem(name,value){
    document.cookie=name+"="+escape(value)+";";
}
function removeItem(name){
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval = getItem(name);
    document.cookie= name + "="+cval+";expires="+exp.toGMTString() + ";";
}
